package cn.xmstore.globals;

import java.io.Serializable;

/**
 * @author： Aeolia
 * @Description： TODO 全局统一响应体，用于所有请求的数据响应规范
 * @Date： 2021/8/21 14:30
 */
public class ResponseResult<T> implements Serializable {

    private Integer code;
    private String message;

    private T data;

    public ResponseResult() {
    }

    public ResponseResult(CODE code, T data) {
        this.code = code.getCode();
        this.message = code.getMessage();
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "ResponseResult{" +
                "code=" + code +
                ", message='" + message + '\'' +
                ", data=" + data +
                '}';
    }
}
